import Main from '@/components/main'
import parentView from '@/components/parent-view'

/**
 * iview-admin中meta除了原生参数外可配置的参数:
 * meta: {
 *  title: { String|Number|Function }
 *         显示在侧边栏、面包屑和标签栏的文字
 *         使用'{{ 多语言字段 }}'形式结合多语言使用，例子看多语言的路由配置;
 *         可以传入一个回调函数，参数是当前路由对象，例子看动态路由和带参路由
 *  hideInBread: (false) 设为true后此级路由将不会出现在面包屑中，示例看QQ群路由配置
 *  hideInMenu: (false) 设为true后在左侧菜单不会显示该页面选项
 *  notCache: (false) 设为true后页面在切换标签后不会缓存，如果需要缓存，无需设置这个字段，而且需要设置页面组件name属性和路由配置的name一致
 *  access: (null) 可访问该页面的权限数组，当前路由设置的权限会影响子路由
 *  icon: (-) 该页面在左侧菜单、面包屑和标签导航处显示的图标，如果是自定义图标，需要在图标名称前加下划线'_'
 *  beforeCloseName: (-) 设置该字段，则在关闭当前tab页时会去'@/router/before-close.js'里寻找该字段名对应的方法，作为关闭前的钩子函数
 * }
 */

export default [
  {
    path: '/login',
    name: 'login',
    meta: {
      title: 'Login - 登录',
      hideInMenu: true
    },
    component: () => import('@/view/login/login.vue')
  },
  // {
  //   path: '/',
  //   name: 'home',
  //   redirect: '/home',
  //   component: Main,
  //   meta: {
  //     hideInMenu: true,
  //     notCache: true
  //   },
  //   children: [
  //     {
  //       path: '/home',
  //       name: '_home',
  //       meta: {
  //         hideInMenu: true,
  //         title: '首页',
  //         notCache: true,
  //         icon: 'md-home'
  //       },
  //       component: () => import('@/view/single-page/home')
  //     }
  //   ]
  // },
  {
    path: '/',
    name: 'user',
    title: '用户管理',
    component: Main,
    meta: {
      hideInBread: true
    },
    children: [
      {
        path: 'user',
        name: '_user',
        meta: {
          title: '用户管理',
          icon: 'md-people'
        },
        component: () => import('@/view/user/list')
      },
      {
        path: 'user_detail',
        name: 'user_detail',
        meta: {
          title: '用户详情',
          notCache: true,
          icon: 'md-people',
          hideInMenu: true
        },
        component: () => import('@/view/user/detail')
      },
      {
        path: 'user_customer_detail',
        name: 'user_customer_detail',
        meta: {
          title: '客户详情',
          notCache: true,
          icon: 'md-people',
          hideInMenu: true
        },
        component: () => import('@/view/user/customerDetail')
      },
      {
        path: 'user_customer_record',
        name: 'user_customer_record',
        meta: {
          title: '跟进记录',
          notCache: true,
          icon: 'md-people',
          hideInMenu: true
        },
        component: () => import('@/view/user/customerRecord')
      },
      {
        path: 'user_team',
        name: 'user_team',
        meta: {
          title: '用户团队',
          notCache: true,
          icon: 'md-people',
          hideInMenu: true
        },
        component: () => import('@/view/user/team')
      }
    ]
  },
  {
    path: '/',
    name: 'good',
    title: '产品管理',
    component: Main,
    meta: {
      hideInBread: true
    },
    children: [
      {
        path: 'good',
        name: '_good',
        meta: {
          title: '产品管理',
          icon: 'md-construct'
        },
        component: () => import('@/view/good/list')
      },
      {
        path: 'good_detail',
        name: 'good_detail',
        meta: {
          title: '产品详情',
          notCache: true,
          icon: 'md-construct',
          hideInMenu: true
        },
        component: () => import('@/view/good/detail')
      },
      {
        path: 'user_customer_detail',
        name: 'user_customer_detail',
        meta: {
          title: '客户详情',
          notCache: true,
          icon: 'md-people',
          hideInMenu: true
        },
        component: () => import('@/view/user/customerDetail')
      },
      {
        path: 'user_customer_record',
        name: 'user_customer_record',
        meta: {
          title: '跟进记录',
          notCache: true,
          icon: 'md-people',
          hideInMenu: true
        },
        component: () => import('@/view/user/customerRecord')
      },
      {
        path: 'user_team',
        name: 'user_team',
        meta: {
          title: '用户团队',
          notCache: true,
          icon: 'md-people',
          hideInMenu: true
        },
        component: () => import('@/view/user/team')
      }
    ]
  },
  {
    path: '/',
    name: 'slider',
    title: '轮播图管理',
    component: Main,
    meta: {
      hideInBread: true
    },
    children: [
      {
        path: 'slider',
        name: '_slider',
        meta: {
          title: '轮播图管理',
          icon: 'md-albums'
        },
        component: () => import('@/view/slider/list')
      },
      {
        path: 'slider_detail',
        name: 'slider_detail',
        meta: {
          title: '轮播图详情',
          notCache: true,
          icon: 'md-albums',
          hideInMenu: true
        },
        component: () => import('@/view/slider/detail')
      }
    ]
  },
  {
    path: '/',
    name: 'sysMsg',
    title: '官方消息',
    component: Main,
    meta: {
      hideInBread: true
    },
    children: [
      {
        path: 'sysMsg',
        name: '_sysMsg',
        meta: {
          title: '官方消息',
          icon: 'md-information-circle'
        },
        component: () => import('@/view/sysMsg/list')
      },
      {
        path: 'sysMsg_detail',
        name: 'sysMsg_detail',
        meta: {
          title: '官方消息详情',
          notCache: true,
          icon: 'md-information-circle',
          hideInMenu: true
        },
        component: () => import('@/view/sysMsg/detail')
      }
    ]
  },
  {
    path: '/',
    name: 'article',
    title: '资讯管理',
    component: Main,
    meta: {
      hideInBread: true
    },
    children: [
      {
        path: 'article',
        name: '_article',
        meta: {
          title: '资讯管理',
          icon: 'logo-buffer'
        },
        component: () => import('@/view/article/list')
      },
      {
        path: 'article_detail',
        name: 'article_detail',
        meta: {
          title: '资讯详情',
          notCache: true,
          icon: 'logo-buffer',
          hideInMenu: true
        },
        component: () => import('@/view/article/detail')
      }
    ]
  },
  {
    path: '/',
    name: 'poster',
    title: '海报管理',
    component: Main,
    meta: {
      hideInBread: true
    },
    children: [
      {
        path: 'poster',
        name: '_poster',
        meta: {
          title: '海报管理',
          icon: 'ios-color-palette'
        },
        component: () => import('@/view/poster/list')
      },
      {
        path: 'poster_detail',
        name: 'poster_detail',
        meta: {
          title: '海报详情',
          notCache: true,
          icon: 'ios-color-palette',
          hideInMenu: true
        },
        component: () => import('@/view/poster/detail')
      }
    ]
  },
  {
    path: '/',
    name: 'cash',
    title: '提现管理',
    component: Main,
    meta: {
      hideInBread: true
    },
    children: [
      {
        path: 'cash',
        name: '_cash',
        meta: {
          title: '提现管理',
          notCache: true,
          icon: 'logo-usd'
        },
        component: () => import('@/view/cash/list')
      }
    ]
  },
  {
    path: '/',
    name: 'loan',
    title: '贷款管理',
    component: Main,
    meta: {
      hideInBread: true
    },
    children: [
      {
        path: 'loan',
        name: '_loan',
        meta: {
          title: '贷款管理',
          notCache: true,
          icon: 'md-cash'
        },
        component: () => import('@/view/loan/list')
      }
    ]
  },
  {
    path: '/',
    name: 'config',
    title: '系统配置',
    component: Main,
    meta: {
      hideInBread: true
    },
    children: [
      {
        path: 'config',
        name: '_config',
        meta: {
          title: '系统配置',
          icon: 'md-settings'
        },
        component: () => import('@/view/config/form.vue')
      }
    ]
  },
  {
    path: '/',
    name: 'newspaper',
    title: '日报管理',
    component: Main,
    meta: {
      hideInBread: true
    },
    children: [
      {
        path: 'newspaper',
        name: '_newspaper',
        meta: {
          title: '日报管理',
          icon: 'ios-paper'
        },
        component: () => import('@/view/newspaper/list.vue')
      },
      {
        path: 'newspaper_detail',
        name: 'newspaper_detail',
        meta: {
          title: '日报详情',
          icon: 'ios-paper',
          notCache: true,
          hideInMenu: true
        },
        component: () => import('@/view/newspaper/detail.vue')
      }
    ]
  },
  {
    path: '/',
    name: 'admin',
    title: '管理员管理',
    component: Main,
    meta: {
      hideInBread: true
    },
    children: [
      {
        path: 'admin',
        name: '_admin',
        meta: {
          title: '管理员管理',
          icon: 'md-glasses'
        },
        component: () => import('@/view/admin/list')
      },
      {
        path: 'admin_detail',
        name: 'admin_detail',
        meta: {
          title: '管理员详情',
          notCache: true,
          icon: 'md-glasses',
          hideInMenu: true
        },
        component: () => import('@/view/admin/detail')
      }
    ]
  },
  {
    path: '/401',
    name: 'error_401',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/401.vue')
  },
  {
    path: '/500',
    name: 'error_500',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/500.vue')
  },
  {
    path: '*',
    name: 'error_404',
    meta: {
      hideInMenu: true
    },
    component: () => import('@/view/error-page/404.vue')
  }
]
